package com.stephen.redisdemo.reference;

/**
 * @author: stephen
 * @create: 2020-03-03 14:49
 * @description: 强引用
 * 即使发生OOM,也不会回收
 */
public class StrongReferenceDemo {

    public static void main(String[] args) {
        Object o1 = new Object();
        Object o2 = o1;
        o1 = null;
        System.gc();
        System.out.println(o2); // o2不为空
    }
}
